package com.xdhl.fu.fi.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xdhl.fu.flight.info.api.domain.FlightStock;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 航班库存信息数据表操作接口
 *
 * @author 朱力维
 * @time 2022/6/18 13:36
 */
@Mapper
public interface FlightStockMapper extends BaseMapper<FlightStock> {

    /**
     * 获取航班库存信息
     *
     * @param flightScheduleDataId 航班计划数据ID
     * @return 航班座位库存信息
     */
    @Select("select data_id, head_seat_count, business_seat_count, economy_seat_count, head_seat_remainder_count, business_seat_remainder_count, economy_seat_remainder_count from flight_stock where flight_schedule_data_id = #{flightScheduleDataId}")
    FlightStock getByFlightScheduleDataId(@Param("flightScheduleDataId") String flightScheduleDataId);

}
